<?
/*
 * @since 2012.03.27
 * @author Charles Koh
 * @returns {Find Sponsor}
 */
	$id = $_GET['id'];
   
	if(!$id) 
	{
		echo '{"message":"No input text for Sponsor ID"}';
	}
	else
	{
		include "../../server/dbconn.php";
 
		$sql = 'select id,name,photo from member where id regexp "^.*'.$id.'.*$" or name regexp "^.*'.$id.'.*$"';

		$result = @mysql_query($sql, $connect);
		$num_match = @mysql_num_rows($result);

		if ($num_match)
		{
			$row = @mysql_fetch_array($result);
			$userid = $row[id];
			echo '{"message":"Find hit Sponsor ID","data":["'.$userid.'","'.$row[name].'"]}';
		} else
    		echo '{"message":"Not Find for Sponsor ID"}';
		
		mysql_close();
	}
?>

